<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <p>1</p>
    <p>2</p>
    <p>3</p>

    <script>



        function Get(ele) {
            // 伪数组
            this.eles = document.querySelectorAll(ele)
        }


        Get.prototype.css = function(prop , value) {
            for(let i = 0 ; i < this.eles.length ; i++) {
                this.eles[i].style[prop] = value ;
            }
        }



        // 这不是构造函数   帮我们new一个实例出来
        function $(ele) {
            // const a = new Get(ele) ;
            // return a 

            return new Get(ele)
        }


        // const a = new Get('p') ;
        // a.css('color' , 'red');

        $('p').css('color' , 'blue')


    </script>
    
</body>
</html>